/*
 * Copyright the original author or authors.
 * 
 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.mozilla.org/MPL/MPL-1.1.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.kairos.engine 
{ 
	
	import com.bourre.log.PixlibStringifier;
	
	import flash.events.Event;
	
	/**
	 * The <code>RTEvent</code> is dispatched by the <code>RTBeacon</code>
	 * in the <code>onEnterFrame</code> event.
	 * 
	 * <p>The <code>RTEvent</code> store values from the <code>RTBeacon</code>
	 * object. You can access those values with the <code>getStep</code> and 
	 * <code>getStepInSecond</code> methods.</p>
	 * 
	 * @author	Cédric Néhémie
	 * @see		RTBeacon
	 */
	public class RTEvent extends Event
	{
		protected var _nSc : Number;
		protected var _nS : Number;
	
		public function RTEvent ( type : String, bubbles:Boolean = false, cancelable:Boolean = false )
		{
			super ( type, bubbles, cancelable );
			_nSc = _nS = 0;
		}
		
		/**
		 * Return the last frame duration in milliseconds.
		 *	
		 * @return	<code>Number</code>
		 * @see		RTBeacon#getStep()
		 */	
		public function getStep () : Number
		{
			return _nS;
		}
		
		/**
		 * Define the value for the {@code getStep} return value. 
		 */
		public function setStep ( n : Number ) : void
		{
			_nS = n;
		}
		
		/**
		 * Return the last frame duration in seconds.
		 *	
		 * @return	<code>Number</code>
		 * @see		RTBeacon#getStepInSecond()
		 */	
		public function getStepInSecond () : Number
		{
			return _nSc;
		}
		
		/**
		 * Define the value for the {@code getStepInSecond} return value. 
		 */
		public function setStepInSecond ( n : Number ) : void
		{
			_nSc = n;
		}
		
		/**
		 * Return the String representation of the object.
		 */	
		public override function toString() : String
		{
			return PixlibStringifier.stringify( this );
		}
	}
}